import request from "@/utils/request";
import store from "@/store";

// 查询数据
export function getDataListApi(params) {
  return request({
    url: '/crm/plan/list',
    method: 'GET',
    params: {
      ...params,
      userId: store.state.user.id,
      deptId: store.state.user.deptId,
    }
  })
}

// 查询详细数据
export function getDataInfoApi(id) {
  return request({
    url: '/crm/plan/detail/' + id,
    method: 'GET',
    // params: {
    //   ...params,
    //   userId: store.state.user.id,
    //   deptId: store.state.user.deptId,
    // }
  })
}

// 增加数据
export function addDataApi(data) {
  return request({
    url: '/crm/plan/add',
    method: 'POST',
    data
  })
}

// 修改数据
export function updateDataApi(data) {
  return request({
    url: '/crm/plan/updatePlanItem',
    method: 'PUT',
    data
  })
}

// 删除数据
export function deleteDataApi(data) {
  return request({
    url: '/crm/plan/deletePlanItem',
    method: 'DELETE',
    data
  })
}
